<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>jquery基础</title>
    <style>
    </style>
    <script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
    </script>

</head>

<body>
    <script>

        // 文档加载完成写法二
        $(function () {
            // 开始写 jQuery 代码...
            $("button").click(function () {
                // 加载ajax_load_test.txt到div中，覆盖
                $("div").load("ajax_load_test.txt");
            });
        });

        $("button").click(function () {
            $("#div1").load("demo_test.txt", function (responseTxt, statusTxt, xhr) {
                if (statusTxt == "success")
                    alert("外部内容加载成功!");
                if (statusTxt == "error")
                    alert("Error: " + xhr.status + ": " + xhr.statusText);
            });
        });

    </script>
    <div style="border: 1px solid green">

    </div>
    <button>load</button>

</body>

</html>